home *** CD-ROM | disk | FTP | other *** search
/ Java Developer's Companion / Java Developer's Companion.iso / binaries / Windows / jsdk / README < prev   
Encoding:
Text File  |  1997-07-30  |  5.3 KB  |  150 lines

  1. README - Java(tm) Servlet Development Kit (JSDK) 1.0.1 
  2. ------
  3. The Java Servlet Development Kit (JSDK) can be used to develop and test
  4. server extensions based on the servlet API. Included is a standalone
  5. server (called the ServletRunner) that can be used to test servlets
  6. before running them in a servlet-enabled web server.
  7.  
  8. In addition to the ServletRunner, code to run servlets in the following 
  9. commercial web servers is provided in this release:
  10.  
  11.     Netscape Enterprise and FastTrack 2.x
  12.     Netscape Enterprise 3.0beta3
  13.         (see README.netscape for more information)
  14.     Microsoft IIS 2.x and 3.x
  15.     Apache
  16.         (see README.apache for more information)
  17.  
  18. Please note that the code for these implementations is released with this
  19. package. 
  20.  
  21. Files included in the JSDK:
  22.  
  23.     README        this file
  24.     README.netscape    installation instructions for Netscape servlet support
  25.     README.apache    installation instructions for Apache servlet support
  26.     bin/srun.exe    ServletRunner (on Win32 systems only)
  27.     bin/srun    ServletRunner (on UNIX systems only)
  28.     lib/classes.zip    javax.servlet and sun.servlet classes
  29.     src        javax.servlet and sun.servlet.netscape class sources
  30.     sBETAervlets    sample servlets and source code
  31.     doc/apidoc    api documentation
  32.  
  33.  
  34. Bugs fixed in this release:
  35.  
  36. Bug 4059897 - POST operations combined with keepalive will no longer throw spurious Invalid Request exceptions.
  37.  
  38. Bug 4056742 - Win32 installer allows product to register user specified
  39.               directory rather what's set as the default directory.
  40.  
  41.  
  42. Starting the Servlet Runner
  43. ---------------------------
  44. Before starting the servlet runner, first add the JSDK bin directory to
  45. your search path:
  46.  
  47.     % setenv PATH /usr/local/jsdk/bin:$PATH        (on UNIX)
  48.  
  49.     C> set PATH=C:\jsdk;%PATH%            (on Win32)
  50.  
  51. Then, start the servlet runner:
  52.  
  53.     % srun -d <servlet-dir> -r <document-dir>    (on UNIX)
  54.  
  55.     C> srun -d <servlet-dir> -r <document-dir>    (on Win32)
  56.  
  57. The argument <servlet-dir> specifies the directory containing servlets
  58. and <document-dir> is the document root directory for serving web pages.
  59. The default for both directories is the current directory, so if the
  60. servlet you are testing is in the current directory then no arguments need
  61. to be specified. In addition, the following options are recognized by the
  62. ServlerRunner, along with the default values if not specified:
  63.  
  64.     -p port    port number to listen on (8080)
  65.     -b backlog    backlog parameter for accepting new connections (50)
  66.     -m max    maximum number of connection handlers (100)
  67.     -t timeout    connection timeout in milliseconds (5000)
  68.     -d dir    servlet directory (current directory)
  69.     -r root    document root directory (current directory)
  70.     -s filename    servlet properties file (<servletdir>/servlets.properties)
  71.     -v        generate verbose output (off)
  72.  
  73. Invoking Servlets
  74. -----------------
  75. The standard way to invoke a servlet in any server is with a URI like the
  76. following:
  77.  
  78.     /servlet/<servlet-name>/<path-info>?<query-args>
  79.  
  80. The name of the servlet is <servlet-name> and is the class name of the
  81. servlet, <path-info> is optional path information for the servlet, and
  82. <query-args> is optional query string arguments for the servlet.
  83.  
  84. For example, if you had started the ServletRunner on host 'eno' within
  85. the directory 'servlets' containing sample servlets, then from any browser
  86. you could run the "snoop" servlet with the following URL:
  87.  
  88.     http://eno:8080/servlet/SnoopServlet/foo/bar?a=z
  89.  
  90. This will invoke SnoopServlet with path info '/foo/bar' and query string
  91. 'a=z'. The SnoopServlet will echo the request headers and query string
  92. arguments back to the client.
  93.  
  94. Initialization Parameters
  95. -------------------------
  96.  
  97. Servlet initialization parameters can be set in the servlet runner just as
  98. they can in the JavaWebServer.  To set them you need to follow these steps:
  99.  
  100. 1) Create a servlets.properties file.  This file will contain the name of
  101.    the servlet and the initialization parameters of the servlet, in this 
  102.    format:
  103.  
  104.     servlet.<servletname>.code=<servletclass>
  105.     servlet.<servletname>.initArgs=<name=value>,<name=value>
  106.  
  107.    For example:
  108.  
  109.     servlet.snoop.code=SnoopServlet
  110.     servlet.snoop.initArgs=test1=1,test2=2
  111.  
  112. 2) Either place the properties file in the default location (which will 
  113.    be your servlet directory, named servlets.properties), or specify the
  114.    name of the servlets.properties file on startup with the -s arg.
  115.  
  116. Now, if you call up SnoopServlet with the name snoop, as in
  117.  
  118.     http://host:port/servlet/snoop
  119.  
  120. it's output will include the two init parameters.  Calling the servlet by
  121. class, as in
  122.  
  123.     http://host:port/servlet/SnoopServlet
  124.  
  125. will report no init parameters.
  126.  
  127.  
  128. Testing your setup
  129. ------------------
  130.  
  131. To test your setup and ensure that it works correctly, start the Servlet Runner
  132. as described above, then call up a servlet in your browser.  A good test
  133. servlet to try is SnoopServlet
  134.  
  135. Limitations
  136. -----------
  137. Current limitations:
  138.  
  139.    If a servlet class file is changed, then you will need to restart the
  140.    server in order for the change to take effect.
  141.  
  142. Problems
  143. --------
  144. If you have any questions or problems with the this JSDK 1.0 release
  145. then please send email to java-server-feedback@javasoft.com.
  146.  
  147. For more discussion of servlets, consider joining the JSERV-INTEREST mailing 
  148. list.  For information on subscribing to this list, check our webpage at
  149. http://jserv.javasoft.com/
  150.